<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>页面历史2</title>
    <script>
        // history.pushState({msg:"hello1"},"","/1");
        // history.pushState({msg:"hello2"},"","/2");
        // history.pushState({msg:"hello3"},"","/3");
        // history.pushState({msg:"hello4"},"","/4");
        // window.onpopstate=function(e){
        //     console.log(e);
        // }
        history.replaceState({msg:"hello0"},"","/0");
    </script>
</head>
<body>
    <h1>
        history2
    </h1>
    <a href="./history3.html">history3</a>
    <button onclick="history.forward()">前进</button>
    <button onclick="history.back()">后退</button>
    <button onclick="history.go(-2)" >回到首页</button>
</body>
</html>